//
//  KZExperienceCell.m
//  xiaorizi
//
//  Created by kun on 15/10/28.
//  Copyright © 2015年 origin. All rights reserved.
//

#import "KZExperienceCell.h"
#import "UIImageView+WebCache.h"


@interface KZExperienceCell ()
@property (weak, nonatomic) IBOutlet UIImageView *themeImgView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *subTitleLabel;
@property (weak, nonatomic) IBOutlet UIButton *collectButton;

@end

@implementation KZExperienceCell
- (IBAction)collectButtonClicked:(id)sender {
}

- (void)awakeFromNib {
    // Initialization code
    //添加图片的点击事件
    
    _themeImgView.userInteractionEnabled  = YES;
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(themeImgViewClicked:)];
    [_themeImgView addGestureRecognizer:tap];
    
}

-(void)themeImgViewClicked:(UITapGestureRecognizer *)tap
{
    
    if(self.experienceImgViewBlock)
    {
        self.experienceImgViewBlock(self,_model);
    }
}


-(void)setModel:(ExperienceEventsModel *)model
{
    _model =model;
    //填充数据
    [_themeImgView sd_setImageWithURL:[NSURL URLWithString:model.imgs]];
    _titleLabel.text = model.title;
    _subTitleLabel.text = model.tag;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
